package com.hqyj.controller;

import com.hqyj.pojo.SysTable;
import com.hqyj.service.TableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@RequestMapping("/table")
@Controller
public class TableController {

    @Autowired
    TableService tableService;

    @RequestMapping("/tablePage")
    public String tablePage(){

        return "table/tableList";
    }

    @RequestMapping("/tableMenu")
    public String tableMenu(){

        return "table/tableList";
    }

    @RequestMapping("/tableMessage")
    public String tableMessage(){

        return "table/tableList";
    }

    @RequestMapping("/tableListAjax")
    @ResponseBody
    public HashMap<String,Object> showTables(SysTable table){

        return tableService.showTableList(table);
    }

    //没有作用的
    @RequestMapping("/tableUpdateAjax")
    @ResponseBody
    public HashMap<String,Object> tableUpdate(SysTable table){

        return tableService.tableUpdate(table);
    }


    @RequestMapping("/updateAjax")
    @ResponseBody
    public HashMap<String,Object> update(SysTable table){

        return tableService.Update(table);
    }



}
